package com.alibaba.aone.casestudy.common.utils;

/**
 * 类MetaKeyUtil.java的实现描述：TODO 类实现描述
 * 
 * @author yongchun.chengyc 2011-5-4 下午12:15:57
 */
public class MetaKey {

	private String category;
	private int key;

	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public int getKey() {
		return key;
	}

	public void setKey(int key) {
		this.key = key;
	}

	public MetaKey(String category, int key) {
		this.category = category;
		this.key = key;

	}

	@Override
	public boolean equals(Object obj) {
		if (obj instanceof MetaKey) {
			MetaKey key = (MetaKey)obj;
			if (this.category.equals(key.getCategory())
					&& (this.key) == key.getKey()) {
				return true;
			}
		}

		return false;

	}

	@Override
	public int hashCode() {

		return (category + key).hashCode();
	}

	@Override
	public String toString() {

		return category + "   " + key;
	}

}
